import api from "./instance"
const cookie = encodeURIComponent(window.sessionStorage.getItem("cookie"))
//*首页banner、推荐歌单分类、推荐歌单内容、推荐歌单内容详情*
const getBanner = () => {return api.get("/banner",{}) }
const getHighQualitySongsMenu = () =>{return api.get ("/playlist/hot",{})}
const getHighQualitySongsMenuContent = (limit,offset,series) =>{return api.get (`/top/playlist?limit=${limit}&offset=${offset}&cat=${series}`,{})}
const getHighQualitySongsMenuDetail = (id) =>{return api.get(`/playlist/detail?id=${id}`,{})}
const getLoginKey = () =>{return api.get ("/login/qr/key",{ timerstamp: new Date().getTime(),})}
const getLoginQrCode = (key) =>{return api.get(`/login/qr/create?key=${key}`,{ timerstamp: new Date().getTime(),})}
const getLoginCookie = (key) =>{return api.get(`/login/qr/check?key=${key}`,{ timerstamp: new Date().getTime(),})}
const getLoginStatus = () =>{return api.get("/login/status")}
//*获取歌手分类列表*
const singerList = () =>{return api.get("/artist/list",{})}
const singerDetail = (id) =>{return api.get(`/artist/detail?id=${id}`)}
const singerAllSongs = (id) =>{return api.get(`/artist/songs?id=${id}`)}
//login
const loginKey = () =>{return api.get (`/login/qr/key`,{})}
export {
  getBanner,
  getHighQualitySongsMenu,
  getHighQualitySongsMenuContent,
  getHighQualitySongsMenuDetail,
  getLoginKey,
  getLoginQrCode,
  getLoginCookie,
  getLoginStatus,
  singerList,
  singerDetail,
  singerAllSongs
}